package spe.ui.wizard;

import java.io.File;

import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class FileContentProvider implements ITreeContentProvider
{

	@Override
	public Object[] getChildren(Object parent) {
	File file = (File) parent;
	return file.listFiles();
	}

	public Object[] getElements(Object inputElement) {
	return (Object[]) inputElement;
	}

	@Override
	public Object getParent(Object element) {
	File file = (File) element;
	return file.getParentFile();
	}

	@Override
	public boolean hasChildren(Object parent) {
	File file = (File) parent;
	return file.isDirectory();
	}

	@Override
	public void dispose() {

	}

	@Override
	public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
	}
}
